package com.school.fuyuan.business.mapper;

import com.school.fuyuan.business.model.po.InfoManage;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author zrhong
 * @version 1.0
 * @date 2019/3/7 22:00
 * @description
 */
@Mapper
public interface InfoManageMapper {

    List<InfoManage> getRepeatInfo(@Param("num1") String num1,
                                   @Param("num2") String num2,
                                   @Param("parentName1") String parentName1,
                                   @Param("parentName2") String parentName2,
                                   @Param("studentName") String studentName,
                                   @Param("pageMin") int pageMin,
                                   @Param("pageSize") int pageSize);

    void insertInfoManage(InfoManage infoManage);

    List<InfoManage> getInfoManageList(@Param("userId") String userId,
                                       @Param("pageMin") int pageMin,
                                       @Param("pageSize") int pageSize);

    int getInfoManageListCount(String userId);

    InfoManage getInfoManage(@Param("id") int id);

    int updateInfoManage(@Param("infoManage") InfoManage infoManage,
                         @Param("userId") String userId);

    int changeFollow(@Param("id") int id,
                     @Param("userId") String userId,
                     @Param("followUserName") String followUserName,
                     @Param("followUserId") String followUserId);

    List<InfoManage> searchInfoManages(@Param("mobile") String mobile,
                                       @Param("name") String name,
                                       @Param("pageMin") int pageMin,
                                       @Param("pageSize") int pageSize);

    int searchInfoManagesCount(@Param("mobile") String mobile,
                               @Param("name") String name);

    void batchAddInfoManage(@Param("infoManageList") List<InfoManage> infoManageList);

    void insertApptInfo(@Param("id") int id,
                        @Param("followPersonId") String followPersonId);

    @Update("update appt_info set status=0 where info_id=#{id}")
    void updateApptStatus(int id);

    int getRepeatInfoCounts(@Param("num1") String num1,
                            @Param("num2") String num2,
                            @Param("parentName1") String parentName1,
                            @Param("parentName2") String parentName2,
                            @Param("studentName") String studentName);

    void deleteInfoManges(@Param("userId") String userId,
                         @Param("infoIds") List<Integer> infoIds);
}
